package ogs.game.core;

import ogs.game.protocol.MsgDecoder;
import ogs.game.protocol.MsgEncoder;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

public class MsgCodecFactory implements ProtocolCodecFactory {
	
	private ProtocolEncoder encoder;
	private ProtocolDecoder decoder;
	
	public MsgCodecFactory() {
		encoder = new MsgEncoder();
		decoder = new MsgDecoder();
	}

	@Override
	public ProtocolDecoder getDecoder(IoSession session) throws Exception {
		return decoder;
	}

	@Override
	public ProtocolEncoder getEncoder(IoSession session) throws Exception {
		return encoder;
	}

}
